home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Application Source ƒ / Documentation ƒ / Adding New Items < prev    next >
Encoding:
Text File  |  1995-12-04  |  2.5 KB  |  58 lines  |  [TEXT/SPM ]

  1. Steps to add new functionality to the IC application:
  2.  
  3.     1.  Add a user item for the button in the main dialog, res id 200.  You
  4.         may need to change the size of the dialog, but try not to shuffle
  5.         existing items (users should be used to the location of existing
  6.         items).
  7.     2.  Edit the WHAT resource, id 200, to add your button to the list.
  8.     3.  Add an icon family with resource id 200 + your dialog item
  9.         (i.e. if your item is 12, make an icon family with id 212).
  10.         Also add the string to display under your icon to STR# res id
  11.         130.
  12.     4.  Build a dialog to handle your items.  The trick here is to try to
  13.         reuse existing code for some items.  IC already includes a
  14.         nice set of routines for working with text strings; there are
  15.         other built-in things too.  Get to know the built in stuff and
  16.         reuse it as much as possible.
  17.     5.  Don't forget to add your WHAT resource...
  18.     6.  Don't forget to add your item to the MENU resource.
  19.     7.  Optional - Add your item to the "IC Window Globals.h" file.
  20.         Note this is not required, the C version of the IC app
  21.         can handle changes to the number of WHAT resources.
  22.         
  23. At this point you are at a crossroads.  If you were able to implement
  24. your entire dialog by using the WHATs that already exist, then you
  25. are done.  Just re-compile the app and you should see your icon on the
  26. main dialog and you should be able to use it without any problems.
  27.  
  28. However, if you needed to create a new WHAT (i.e. when I was adding
  29. a SOCKS window, I wanted to add a 'CBOX' WHAT to do a checkbox for
  30. enabling/disabling the use of SOCKS), then you must continue with the
  31. next steps.
  32.  
  33.     8.  The resource file is done; save it and get out of it.
  34.     9.  For each new WHAT you need to create, do the following:
  35.         
  36.         a.  Create the header and source file; include the source
  37.         file into the project.
  38.         
  39.         b.  Write the code to handle the WHAT; remember that the
  40.         what can react to an open, flush, close, click, key, and
  41.         idle event; use those that you feel that you need to.  You'll
  42.         probably need at least an open & flush proc.
  43.         
  44.         c.  Open "IC Window Globals.h" and add your whatXXXX to
  45.         the enumeration; add it before whatLAST.
  46.         
  47.         d.  Open "IC Windows.c" and add your callbacks to the
  48.         InitWhats() function, your header file.
  49.         
  50.     10.  Build your app (fix any bugs ;-)
  51.     
  52. At this point you have a modified version of the Internet Config application
  53. which can be used to edit your prefs.
  54.  
  55. Of course, you should distribute your new application and code so other
  56. IC programmers will include your modifications when they make a customized
  57. IC application ;-)
  58.